package com.luohh.treeroom.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.luohh.treeroom.dto.BasePage;
import com.luohh.treeroom.dto.BasePageResult;
import com.luohh.treeroom.dto.BaseResult;
import com.luohh.treeroom.entity.Ad;
import com.luohh.treeroom.mapper.AdMapper;
import com.luohh.treeroom.service.IAdService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 罗辉煌
 * @since 2020-02-18
 */
@Service
@Slf4j
public class AdServiceImpl extends ServiceImpl<AdMapper, Ad> implements IAdService {

    @Autowired(required = false)
    AdMapper adMapper;

    @Override
    public BaseResult getAdList(){
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("is_valid", 1);
        List<Ad> wrappers = list(wrapper);
        return new BaseResult(wrappers);
//        return new BaseResult(ad);
    }
}
